# -*- coding: utf-8 -*-
# @Time:2021/04/23 16:18
# @Author:Cindy

from appium import webdriver


class BasePage:

    def __init__(self, driver=None):
        if driver is None:
            caps = {
                "platformName": "android",
                "deviceName": "hongwarts",
                "appPackage": "com.tencent.wework",
                "appActivity": ".launch.WwMainActivity",
                "settings[waitForIdleTimeout]": 0,
                "noReset": "true"
            }
            self.driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", caps)
            self.driver.implicitly_wait(10)
        else:
            self.driver = driver

